; install.nsi
;
;--------------------------------

; The name of the installer
Name "GSim85"

; The file to write
OutFile "gsim85-win32-0.2-1.exe"

; The default installation directory
InstallDir $PROGRAMFILES\GSim85

; The text to prompt the user to enter a directory
DirText "This will install GSim85 on your computer. Choose a directory"

;--------------------------------

; The stuff to install
Section "" ;No components page, name is not important

; Set output path to the installation directory.
; And Put file there
SetOutPath $INSTDIR\share
File ..\data\gsim2.rc
SetOutPath $INSTDIR\share\pixmaps
File ..\pixmaps\about.png
File ..\pixmaps\cbrpoint.xpm
File ..\pixmaps\ctracker.xpm
File ..\pixmaps\dtracker.xpm
File ..\pixmaps\find.png
File ..\pixmaps\gsim.png
File ..\pixmaps\gsim.ico
File ..\pixmaps\keypad.png
File ..\pixmaps\memory.xpm
File ..\pixmaps\port.xpm
File ..\pixmaps\reg.png
File ..\pixmaps\run.png
File ..\pixmaps\small-close.xpm
File ..\pixmaps\source.png
File ..\pixmaps\step.png
File ..\pixmaps\d.xpm
File ..\pixmaps\r.xpm
File ..\pixmaps\s.xpm
File ..\pixmaps\extra.xpm

SetOutPath $INSTDIR\share\help

File ..\help\ascending.sim
File ..\help\ascending.txt
File ..\help\use.txt

SetOutPath $INSTDIR
File gsim85.exe

;create desktop shortcut
  CreateShortCut "$DESKTOP\GSim85.lnk" "$INSTDIR\gsim85.exe" "" "$INSTDIR\share\pixmaps\gsim.ico" 0
 
;create start-menu items
  ;CreateDirectory "$SMPROGRAMS\GSim85"
  CreateShortCut "$SMPROGRAMS\GSim85.lnk" "$INSTDIR\gsim85.exe" "" "$INSTDIR\share\pixmaps\gsim.ico" 0
  ;CreateShortCut "$SMPROGRAMS\GSim85\Uninstall.lnk" "$INSTDIR\Uninstall.exe" "" "$INSTDIR\Uninstall.exe" 0
   
;write uninstall information to the registry
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\GSim85" "DisplayName" "GSim85 (remove only)"
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\GSim85" "UninstallString" "$INSTDIR\Uninstall.exe"
 
  WriteUninstaller "$INSTDIR\Uninstall.exe"

SectionEnd ; end the section

;--------------------------------    
;Uninstaller Section  
Section "Uninstall"
   
;Delete Files 
  RMDir /r "$INSTDIR\*.*"    
 
;Remove the installation directory
  RMDir "$INSTDIR"
  
;Delete Start Menu Shortcuts
  Delete "$DESKTOP\GSim85.lnk"
  Delete "$SMPROGRAMS\GSim85.lnk"
  
;Delete Uninstaller And Unistall Registry Entries
  DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\GSim85"
  DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\GSim85"  
  
SectionEnd
